// index.js
// 获取应用实例
const app = getApp()
// 20 ，95
Page({
  data: {
    percentage: 5,
    pageHeight: 0,
    picture: '../../images/noTaskBg.png',
    userInfo: {}
  },
  onShow(){
  },
  // 事件处理函数
  bindViewTap() {
  },
  onLoad() {
    this.setData({
      userInfo: app.globalData.userInfo
    });
  },
  onShow() {
    const self = this;
    const windowHeight = wx.getSystemInfoSync().windowHeight;
    const query = wx.createSelectorQuery();
    query.select('.minInfo').boundingClientRect(rect => {
      self.setData({
        pageHeight: rect.height - windowHeight
      })
    }).exec();
  },
  onPageScroll (e) { 
    const currentHeight = e.scrollTop;
    let value = (currentHeight / this.data.pageHeight) * 100;
    if (value < 5) value = 5;
    if (value > 70) value -= 35;
    this.setData({
      percentage: value
    });
  },
  minInfoEdit() {
    wx.navigateTo({url: '../editInfo/index'});
  },
  onClickLeft() {
      wx.navigateBack({
        delta: 1
      });
  },
  
})
